'use strict';

/**
 * @ngdoc function
 * @name jgappApp.controller:AttendanceShowLocationCtrl
 * @description
 * # AttendanceShowLocationCtrl
 * Controller of the jgappApp
 */
angular.module('jgappApp')
    .controller('AttendanceShowLocationCtrl', function ($scope, $routeParams, MapService, Util) {
        var vm = this;
        // 默认地址坐标
        var point = {
            longitude: $routeParams.lng,
            latitude: $routeParams.lat
        };
        this.title="位置信息";
        if ($routeParams.distance) {
            this.title = Util.calcDistance($routeParams.distance)
        }
        this.ak = MapService.getAk();
        // 初始化地图
        var initMap = function () {
            vm.offlineOpts = { retryInterval: 5000 };
            vm.mapOptions = {
                center: point,
                zoom: 18,
                city: "NanChang",
                enableDragging: false,
                markers: [point]
            };
        }
        initMap()
    });
